


public class GraphNode {
    private int nodeNumber, //in this program the name and node number are the same
                outDegree, adjList[];
    
    //default constructor
    public GraphNode() {
        nodeNumber = outDegree = 0;
        adjList = null; }
    //constructor
    public GraphNode(int nameOrNumber, int outDegrees) {
        nodeNumber = nameOrNumber;
        outDegree = outDegrees;
        adjList = new int[outDegree]; }
    
    //get-accessor methods
    public int getNodeNumber() {
        return nodeNumber; }
    public int getOutDegree() {
        return outDegree; }
    public int getAdjListIndex(int index) {
        return adjList[index]; }
    
    //set-accessor methods
    public void setAdjListIndex(int adjNode, int index) {
        adjList[index] = adjNode; }
}
